﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Jemgine.Engine
{
    public class AnimationModule : Module
    {
        List<AnimatedSkeleton> _skeletons = new List<AnimatedSkeleton>();
        
        public void Add(AnimatedSkeleton _comp)
        {
            _skeletons.Add(_comp);
        }

        public void Remove(AnimatedSkeleton _comp)
        {
            _skeletons.Remove(_comp);
        }

                public override void BeginSimulation()
        {
            _skeletons.Clear();
        }

        public override void Update(float ElapsedSeconds)
        {
            foreach (var Comp in _skeletons)
                if (Comp.Enabled) Comp.Update(ElapsedSeconds);
            
        }
    }
}
